home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PROGEDIT / 2123.ZIP / ADVANCED.HLP < prev    next >
Text File  |  1988-10-22  |  9KB  |  253 lines

  1.       Some Advanced Tips On Using WindE
  2.       ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  3. To be able to take maximum advantage of
  4. WindE's power, the user should read the WindE
  5. User's Guide from cover to cover.  Chapter 3
  6. provides some basic examples on how to use
  7. WindE. This file gives some examples of using
  8. WindE that are not necessarily obvious.
  9.  
  10. Finding Text
  11. ▀▀▀▀▀▀▀ ▀▀▀▀
  12.  
  13. One of WindE's strongest features is its
  14. ability to find the Selected Text.  In all
  15. of the "Point and Shoot" editors we have
  16. compared it to──each required that the user
  17. type in the text to be found (this is tough
  18. when searching for whole paragraphs).
  19.  
  20. The ability to select text and search for
  21. other occurrences is a quick way to move
  22. around in a file:
  23.  
  24.     ■ select some text
  25.     ■ place the cursor at the beginning of
  26.       the file
  27.     ■ do a find
  28.     ■ if no other occurrences exist──you are
  29.       notified (to get back to the original
  30.       text──deselect and do a find)
  31.  
  32. Comparing Text
  33. ▀▀▀▀▀▀▀▀▀ ▀▀▀▀
  34. Find can also be used to compare two blocks
  35. of text:
  36.  
  37.     ■ open two files to be compared
  38.     ■ select one entire file
  39.     ■ place the cursor at the beginning of
  40.       the other file
  41.     ■ do a find
  42.  
  43. If the files are equivalent, the selection
  44. will move to the second file.
  45.  
  46. Swapping Text
  47. ▀▀▀▀▀▀▀▀ ▀▀▀▀
  48. There is a simple technique for swapping the
  49. position of two blocks of text:
  50.  
  51.     ■ select the first block and delete it
  52.     ■ select the second block and move it
  53.     ■ place the cursor at the previous
  54.       position of the second block
  55.     ■ deselect and do a copy
  56.  
  57. This technique works because the first
  58. deletion leaves the cursor in the correct
  59. position for the move and sets up the find
  60. buffer for the copy.  Note: do not forget to
  61. deselect before the copy, since you want to
  62. copy the contents of the find buffer.
  63.  
  64. Replacing Text
  65. ▀▀▀▀▀▀▀▀▀ ▀▀▀▀
  66. Replacing the selection is another one of
  67. those features that does not seem to exist
  68. in other editors, therefore, some comments
  69. may help clarify its use.
  70.  
  71. First of all──HOW IS THE REPLACE BUFFER
  72. DEFINED?  There are three possible ways:
  73.  
  74.     ■ deleting a selection erases the
  75.       replace buffer
  76.     ■ copying a selection initializes the
  77.       replace buffer to contain a copy of
  78.       the selection
  79.     ■ moving a selection initializes the
  80.       replace buffer to contain a copy of
  81.       the selection
  82.  
  83. Typically, if you do not need to do a copy,
  84. the replace buffer is setup by selecting text
  85. and moving it to itself (place the cursor
  86. immediately after, or on the first character
  87. of the selected text and do a move).
  88.  
  89. HOW DO YOU USE THE REPLACE BUFFER?  A common
  90. use is to step through a file using the find
  91. command and then executing replace to replace
  92. each occurrence of the found text.  A less
  93. common and often overlooked application is
  94. the ability to select various different text
  95. blocks and replace each of them.
  96.  
  97. Global Search and Replace
  98. ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀ ▀▀▀▀▀▀▀
  99. The replace buffer is also used by the global
  100. command.  Simply stated, this command does a
  101. series of finds and replaces to automate
  102. global changes.  This command is discussed
  103. in detail in the Editing Chapter of the
  104. manual, however, because of the importance
  105. of global, a sample editing session will
  106. be described here.
  107.  
  108. Global repeats a sequence of finds and
  109. replaces until the Find Delimiter or the end
  110. of the file is reached. Note that the setup
  111. for global will also apply to individual
  112. finds and replaces.  The Find Delimiter is a
  113. line that begins with two carets (^^) and
  114. contains no other text.
  115.  
  116. To illustrate the global function, look for a
  117. filename in the Directory Window called
  118. "global.txt" and edit it.  Adjust the window
  119. size and position to allow you to continue
  120. reading this file (to the right of this
  121. window should be fine). After opening the
  122. window, you should see several lines with
  123. the words "sample.txt."
  124.  
  125. Position the Arrow over the letters "txt" in
  126. the first line and do a Stationary Select.
  127. The letters "txt" should now be selected. Do
  128. a delete. Do a global. Move the Arrow to the
  129. "N" in the dialog box and click any mouse
  130. button to allow the global to run without
  131. user verification. All of the occurrences of
  132. "txt" before the Find Delimiter are deleted.
  133. After the first delete operation, the Find
  134. Buffer contained a copy of "txt" and the
  135. Replace Buffer was erased. When the global
  136. function executed, all occurrences of "txt"
  137. before the Find Delimiter were found and
  138. replaced with nothing. This is referred to
  139. as a "Global Delete."
  140.  
  141. Select the period at the end of the first
  142. line and delete it.  Select the ".txt" at the
  143. end of the last line and do a copy.
  144. Position the Arrow on a blank line or after
  145. one of the lines ending in a period and click
  146. the Right Button to turn off the Selection
  147. (referred to as "Deselection"). Do a global
  148. and respond to the dialog box with a no by
  149. entering an "N" on the keyboard.  All of the
  150. periods before the Find Delimiter are
  151. replaced with ".txt".  This is referred to as
  152. a "Global Replace."  As in the case of the
  153. global delete, the Find Buffer was set up by
  154. the deletion of the period.  However, in this
  155. case, the Replace Buffer was initialized by
  156. doing the copy of ".txt".  When the global
  157. function executed, all periods before the
  158. Find Delimiter were found and replaced with
  159. ".txt".
  160.  
  161. To illustrate an individual replace, select
  162. one of the lines following the Find Delimiter
  163. and do a replace.  The line is replaced with
  164. the contents of the Replace Buffer──".txt".
  165.  
  166. In the global replace example above, there
  167. was a convenient example of text to copy in
  168. order to set up the Replace Buffer.  When
  169. there is not an example of replace text to
  170. copy, type in the replace text after doing
  171. the initial delete and select it.  This
  172. replace text will be in the correct position
  173. since the Cursor was positioned at the point
  174. of the deleted text.  Do a move and nothing
  175. appears to happen since you are moving to the
  176. current position.  This seemingly unnecessary
  177. move sets up the Replace Buffer just as the
  178. copy did in the above example.  Deselect and
  179. do the global as before.
  180.  
  181. To illustrate this, select the first
  182. occurrence of "txt" and delete it. Type in
  183. "TEXT", select the word "TEXT" and do a move.
  184. Deselect, do a global and respond to the
  185. dialog with a yes.  Each time ".txt" is
  186. found, it is selected and a Dialog Box
  187. prompts:
  188.  
  189.     Replace? [Y], [N] or [A]bort
  190.  
  191. Select each of the possible responses, in
  192. order, one at a time and note the result.
  193.  
  194. The deselection before doing the global is
  195. important to note.  If you forget to do the
  196. deselection, global will search for the
  197. Selection instead of the contents of the
  198. Find Buffer.  If the circumstances were such
  199. that you wanted WindE to search for the
  200. Selection, then of course, WindE would do
  201. that as well. Indeed, because WindE will use
  202. either the Selection or the Find Buffer and
  203. the Find and Replace Buffers can be setup a
  204. couple of different ways, there are several
  205. ways to setup the global command beyond the
  206. three examples given here.
  207.  
  208. Global searching and replacing in WindE is
  209. not intuitive to new users.  The design
  210. philosophy was to make the setup for this
  211. command as fast and as painless as possible.
  212. Time spent learning to use global will be
  213. repaid many times as you continue to edit
  214. with WindE.
  215.  
  216. Fast Movement Between Directories
  217. ▀▀▀▀ ▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀
  218. If an application has you constantly moving
  219. between several sub-directories, there is an
  220. easy method for doing this without having to
  221. constantly type in the pathnames or to do
  222. tedious relative movements.
  223.  
  224. Keep a window open that contains a list of
  225. these pathnames. When you need to move to
  226. the new directory, select the pathname
  227. from the window and execute the directory
  228. command.  If you only need to open a single
  229. file within the new directory, keep the
  230. filename as part of the pathname and do an
  231. edit command instead of moving into the
  232. directory.
  233.  
  234. A common misconception amoung new WindE
  235. users is that the selected pathname has
  236. to be inside of the directory window.
  237. This is not true──WindE does not make any
  238. distinction concerning where the selection
  239. comes from.
  240.  
  241. Nul Window
  242. ▀▀▀▀▀▀▀▀▀▀
  243. The "nul" device provided by DOS can be
  244. opened like a file with WindE.  This is
  245. useful as a temporary note pad for entering
  246. search text and other pieces of text that
  247. you do not want to be saved when you do an
  248. exit.
  249.  
  250.       ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  251.       ▌PRESS: ALT+B to bury this window▐
  252.       ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  253.